<template>
  <div>
    <InnerPageTable class="table" ref="valueSetTable" :config="pageTableConfig">
    </InnerPageTable>
  </div>
</template>

<script>
const columnsFn = () => {
  return [
     {
            title: '修订时间', 
            key: "updateTime",
            width: 180,
       
        },
        {
            title: '更新人',  
            key: "recordUser",
            width: 150,
           
        },
        {
            title: '修订内容', 
            key: "logInfo",
            // width: 300,
           
        },
  ]
}
import coverApi from '@/api/cover.js'
export default {
  name: 'revisionRecord',
  props: {
    taskCode: {
      type: String,
      default: () => undefined
    },
    logType: {
      type: Number,
      default: () => undefined
    },
    recordId: {
      type: String,
      default: () => undefined
    }
  },
  data() {
    return {
      pageTableConfig: {
        loadDataFn: this.getRevisionRecord,
        columns: columnsFn.bind(this)(),
        isPage: false
      }
    }
  },
  created() {
     this.$emit("SetTitle", "修订记录");
     this.$emit("SetPageMinHeight", 200);
     this.$emit("SetPageWidth", 1000);
  },
  mounted() {
    this.$refs['valueSetTable'].load({
      taskCode: this.taskCode,//:"编码",
      logType: this.logType,
      recordId: this.recordId
    })
  },
  methods: {
      getRevisionRecord: tableObj => {
      let { responseProcess, param } = tableObj
      let paramsData = param
      return coverApi.getRevisionRecord(paramsData).then(res => {
            let data = res.data.data || []
            //
            data.sort(function(a,b) {
              return (a.updateTime || 0) > (b.updateTime || 0) ? -1 : 1
            })
            responseProcess({
              records: data,
            })
          })
    },
  }
}
</script>
<style lang="less" scoped>
.table {
   min-height: 300px;
}


</style>

